package com.threeti.mecool.core.domain.model.plan.aspects;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Version;

import org.springframework.beans.factory.annotation.Configurable;

import com.threeti.mecool.core.domain.model.plan.pojo.Job;
import com.threeti.mecool.core.domain.model.plan.pojo.Step;

/**
 * <p/>
 * zhaoxu @ 2012-05-16 11:26
 * <p/>
 */
privileged aspect Job_AJ_Entity {
	declare @type: Job:@Configurable;	
	declare @type: Job:@Entity;
	declare @type: Job:@Table(name = "DM_WF_JOB");
	
	declare @field: Long Job.id:@Id;
	declare @field: Long Job.id:@GeneratedValue(strategy = GenerationType.AUTO);
	declare @field: Integer Job.version:@Version;
	
	declare @field: List<Step> Job.steps:@OneToMany(mappedBy = "job", cascade = CascadeType.ALL, orphanRemoval = true);
	declare @field: List<Step> Job.steps:@OrderBy("stepsOrder");
	declare @field: Step Job.firstStep:@OneToOne;
}
